package entity;

import java.util.ArrayList;

/**
 * @author frankcarnevale
 */
public class Line {
	String nameOfChoice;
	String nameOfDecision;//question: Does a Line need to store the Decision? I forgot why we made this decision
	ArrayList<Edge> edges;
	int position;
	private long dbId = -1; // Need to correctly identify and update lines in the database
	
	public Line(String nameOfChoice, int position){
		edges = new ArrayList<Edge>();
		this.nameOfChoice = nameOfChoice;
		this.position = position;
	}
	
	/**
	 * Gets name of choice corresponding to this line
	 * @return
	 */
	public String getNameOfChoice() {
		return nameOfChoice;
	}
	
	/**
	 * Sets name of choice corresponding to this line
	 * @param nameOfChoice
	 */
	public void setNameOfChoice(String nameOfChoice) {
		this.nameOfChoice = nameOfChoice;
	}
	
	/**
	 * Gets name of decision corresponding to this line
	 * @return
	 */
	public String getNameOfDecision() {
		return nameOfDecision;
	}
	
	/**
	 * Sets name of decision corresponding to this line
	 * @param nameOfDecision
	 */
	public void setNameOfDecision(String nameOfDecision) {
		this.nameOfDecision = nameOfDecision;
	}
	
	/**
	 * Gets ArrayList of edges connected to this line
	 * @return
	 */
	public ArrayList<Edge> getEdges(){
		return edges;
	}
	
	/**
	 * Sets the edges for this line
	 * @param e
	 */
	public void setEdges(ArrayList<Edge> e){
		edges = e;
	}
	
	/**
	 * Adds and edge to the list of edges connected to this line
	 * @param e
	 */
	public void addEdge(Edge e){
		edges.add(e);
	}

	/**
	 * Retrieve the unique DB id for this line
	 * @return
	 */
	public long getDbId() {
		return dbId;
	}

	/** 
	 * Set DB id for this line
	 * @param dbId
	 */
	public void setDbId(long dbId) {
		this.dbId = dbId;
	}
	
	public void setPosition(int pos){
		position = pos;
	}
	
	public int getPosition(){
		return position;
	}
	
	
}
